<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>Squadron-Manager » global</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">Squadron-Manager</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Packages</a></li>
<li><a href="../packages/Default.html"><i class="icon-folder-open"></i> Default</a></li>
<li><a href="../packages/Squadron-Manager.html"><i class="icon-folder-open"></i> Squadron-Manager</a></li>
<li><a href="../packages/Squadron-manager.html"><i class="icon-folder-open"></i> Squadron-manager</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">178</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">0</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-map-marker"></i> Namespaces</li>
<li>
<a href="../namespaces/global.html" title="global"><i class="icon-th"></i>global</a><ul class="nav nav-list nav-namespaces"></ul>
</li>
</ul>
</div>
<div class="span8 namespace-contents">
<ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-th"></i></a><span class="divider">\</span>
</li>
<li class="active"><a href="../namespaces/global.html">global</a></li>
</ul>
<div class="namespace-indent">
<h3>
<i class="icon-custom icon-function"></i> Functions</h3>
<a id="function_Query"></a><div class="element clickable function  function_Query" data-toggle="collapse" data-target=".function_Query .collapse">
<h2>Runs a SQL query, and handles the database errors</h2>
<pre>Query(String $query, \mysqli $ident, String $message) : \type</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Use this function for all your queries, and not mysqli_query. This allows easy
portability to other DBMS's</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$query</h4>
<code>String</code><p>the query to run</p></div>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection</p></div>
<div class="subelement argument">
<h4>$message</h4>
<code>String</code><p>a message to display on success</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>\type</code>for Select returns the mysqli_result, for UPdate, etc returns true on success false for failures</div>
</div></div>
</div>
<a id="function_Result"></a><div class="element clickable function  function_Result" data-toggle="collapse" data-target=".function_Result .collapse">
<h2>Returns a single result from a query</h2>
<pre>Result(\mysqli_result $result, \type $row, \type $field) : string</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$result</h4>
<code><a href="http://php.net/manual/en/class.mysqli_result.php">\mysqli_result</a></code><p>the result to be parsed</p></div>
<div class="subelement argument">
<h4>$row</h4>
<code>\type</code><p>the row you are looking for</p></div>
<div class="subelement argument">
<h4>$field</h4>
<code>\type</code><p>the column you want</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>string</code>returns the cell</div>
</div></div>
</div>
<a id="function_allResults"></a><div class="element clickable function  function_allResults" data-toggle="collapse" data-target=".function_allResults .collapse">
<h2>Creates a 2-d array from a query result</h2>
<pre>allResults(\mysqli_result $result) : Array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>The first level of the array is the row, and the second the column
$result[0]['hi'] would be the column hi for the first row.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$result</h4>
<code><a href="http://php.net/manual/en/class.mysqli_result.php">\mysqli_result</a></code><p>the query result being parsed</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>Array</code></div>
</div></div>
</div>
<a id="function_auditDump"></a><div class="element clickable function  function_auditDump" data-toggle="collapse" data-target=".function_auditDump .collapse">
<h2>Inserts pertinant information for auditable event into AUDIT_DUMP</h2>
<pre>auditDump(String $time, String $fieldName, String $fieldValue) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$time</h4>
<code>String</code><p>the time of the event returned from auditLog</p></div>
<div class="subelement argument">
<h4>$fieldName</h4>
<code>String</code><p>the name of the value being stored, i.e. CAPID, input</p></div>
<div class="subelement argument">
<h4>$fieldValue</h4>
<code>String</code><p>the actual value of the field. i.e. 123456</p></div>
</div></div>
</div>
<a id="function_auditLog"></a><div class="element clickable function  function_auditLog" data-toggle="collapse" data-target=".function_auditLog .collapse">
<h2>Stores and auditable event to the AUDIT_LOG table.</h2>
<pre>auditLog(String $ip, String $type) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>If we have the user's CAPID that will be stored along with the log</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ip</h4>
<code>String</code><p>the IP address of the client</p></div>
<div class="subelement argument">
<h4>$type</h4>
<code>String</code><ul>
<li>the type of event from the table INTRUSION_TYPE</li>
</ul>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>the date and time of the Event formatted for SQL</div>
</div></div>
</div>
<a id="function_bind"></a><div class="element clickable function  function_bind" data-toggle="collapse" data-target=".function_bind .collapse">
<h2>Binds the values to the prepared statement and prepares it for execution.</h2>
<pre>bind(\mysqli_stmt $stmt, String $types, array $bind) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Mysqli_stmt::Bind_param uses referential variables for this, but this function doesn't support that
do not use in a refferential variable way</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$stmt</h4>
<code><a href="http://php.net/manual/en/class.mysqli_stmt.php">\mysqli_stmt</a></code><p>the prepared statement being used</p></div>
<div class="subelement argument">
<h4>$types</h4>
<code>String</code><p>the string of types being used. see mysqli_stmt::bind_param <a href="http://php.net/manual/en/mysqli-stmt.bind-param.php">http://php.net/manual/en/mysqli-stmt.bind-param.php</a></p>
</div>
<div class="subelement argument">
<h4>$bind</h4>
<code>array</code><p>the array of values to actually bind</p></div>
</div></div>
</div>
<a id="function_checkAccountLocks"></a><div class="element clickable function  function_checkAccountLocks" data-toggle="collapse" data-target=".function_checkAccountLocks .collapse">
<h2>Checks if an account is locked from too many bad logins
Checks ACCOUNT_LOCKS and LOGIN_LOG</h2>
<pre>checkAccountLocks(Int $capid) : boolean</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will first if their is ACCOUNT_LOCK in place already from said table, and verifies the lock
is still in effect.  If there isn't one it checks the number of bad logins,and will place a block
Uses the constant MAX_LOGIN for the maximum number of logins in the time from LOCK_TIME</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$capid</h4>
<code>Int</code><p>the user's CAPID you are checking</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>boolean</code>true if there is no lock false if there is a lock</div>
</div></div>
</div>
<a id="function_checkEventPromo"></a><div class="element clickable function  function_checkEventPromo" data-toggle="collapse" data-target=".function_checkEventPromo .collapse">
<h2>Checks if an event-based promotion requirements was passed</h2>
<pre>checkEventPromo(array $results, String $achiev, String $code) : \dateTime | boolean</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>It checks if they did attend that event</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$results</h4>
<code>array</code><p>The array of the requirements from this->promotionRequirements</p>
</div>
<div class="subelement argument">
<h4>$achiev</h4>
<code>String</code><p>the achievement searching for</p></div>
<div class="subelement argument">
<h4>$code</h4>
<code>String</code><p>the code of the requirement typ</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>\dateTime</code><code>boolean</code>if the requirement was passed then return the date, false if failed</div>
</div></div>
</div>
<a id="function_checkPath"></a><div class="element clickable function  function_checkPath" data-toggle="collapse" data-target=".function_checkPath .collapse">
<h2>checkPath()
        </h2>
<pre>checkPath() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="function_cleanInputDate"></a><div class="element clickable function  function_cleanInputDate" data-toggle="collapse" data-target=".function_cleanInputDate .collapse">
<h2>Cleans an input text and matches its pattern against a regular expression</h2>
<pre>cleanInputDate(String $input, String $regex, int $length, String $fieldName) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>See CleanInputInt for how the text is cleaned, except this does not use
cleanShellargs()</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>String</code><p>the Raw input</p></div>
<div class="subelement argument">
<h4>$regex</h4>
<code>String</code><p>the regular expression to check the pattern against</p></div>
<div class="subelement argument">
<h4>$length</h4>
<code>int</code><p>the maximum length of the field</p></div>
<div class="subelement argument">
<h4>$fieldName</h4>
<code>String</code><p>the field name for logging purposed</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>the cleaned input or null if it doesn't match the regex or is too long</div>
</div></div>
</div>
<a id="function_cleanInputInt"></a><div class="element clickable function  function_cleanInputInt" data-toggle="collapse" data-target=".function_cleanInputInt .collapse">
<h2>CleanInputInt-cleans input number</h2>
<pre>cleanInputInt(String $input, Int $length, String $fieldName, bool $exact) : float</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This cleans input numbers against SQL injection, XSS, and remote Execution and file traversing.
It uses the mysqli_real_escape_string htmlspecialchars, and escapshellcmd to do this.
It also checks length, and parses it as a number to prevent other issues. Any issues and the event will be
logged along with the sanatized form of the input</p>

<p>This</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>String</code><p>the raw Input</p></div>
<div class="subelement argument">
<h4>$length</h4>
<code>Int</code><p>the absolue length or maximum lenght the number must be, depending on $exact</p>
</div>
<div class="subelement argument">
<h4>$fieldName</h4>
<code>String</code><p>the name of the input field used for logging</p></div>
<div class="subelement argument">
<h4>$exact</h4>
<code>bool</code><p>true for $length to be exact false for $length to be the max length</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>float</code>The Input Number parsed and cleaned as a floating point</div>
</div></div>
</div>
<a id="function_cleanInputString"></a><div class="element clickable function  function_cleanInputString" data-toggle="collapse" data-target=".function_cleanInputString .collapse">
<h2>Cleans an input String</h2>
<pre>cleanInputString(String $input, Int $length, String $fieldName, bool $empty, bool $shellClean) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>See cleanInputInt for how it cleans the text</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>String</code><p>The raw input</p></div>
<div class="subelement argument">
<h4>$length</h4>
<code>Int</code><p>the maximum allowed length</p></div>
<div class="subelement argument">
<h4>$fieldName</h4>
<code>String</code><p>the field name to be logged</p></div>
<div class="subelement argument">
<h4>$empty</h4>
<code>bool</code><p>false if the String can't be empty, true if it can be empty</p>
</div>
<div class="subelement argument">
<h4>$shellClean</h4>
<code>bool</code><p>true if needs to clean against shell characters</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>returns the cleaned text</div>
</div></div>
</div>
<a id="function_cleanUploadFile"></a><div class="element clickable function  function_cleanUploadFile" data-toggle="collapse" data-target=".function_cleanUploadFile .collapse">
<h2>A function to verify uploaded files.</h2>
<pre>cleanUploadFile(String $index, int $maxSize, String $saveDir, String $MIME_TYPE) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This verifies the proper data type, and that file was uploaded.
  Checks for malicious code. Saves the file in the specified
directory with a new name, a md5hash and the timestamp. It also will handle
any upload errors</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$index</h4>
<code>String</code><p>the index for the file in the $_FILES array</p>
</div>
<div class="subelement argument">
<h4>$maxSize</h4>
<code>int</code><p>the maximum size of the file in bytes</p></div>
<div class="subelement argument">
<h4>$saveDir</h4>
<code>String</code><p>the directory to save the file in</p></div>
<div class="subelement argument">
<h4>$MIME_TYPE</h4>
<code>String</code><p>the mime type of the accepted file type</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>the URL to the saved file or false if there was an error or attack</div>
</div></div>
</div>
<a id="function_close"></a><div class="element clickable function  function_close" data-toggle="collapse" data-target=".function_close .collapse">
<h2>Closes a database connection</h2>
<pre>close(\mysqli $ident) : boolean</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection to close</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>boolean</code>true on success false otherwise</div>
</div></div>
</div>
<a id="function_close_stmt"></a><div class="element clickable function  function_close_stmt" data-toggle="collapse" data-target=".function_close_stmt .collapse">
<h2>Closes a prepared Statement</h2>
<pre>close_stmt(\mysqli_stmt $stmt) : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$stmt</h4>
<code><a href="http://php.net/manual/en/class.mysqli_stmt.php">\mysqli_stmt</a></code><p>the statement to close</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>bool</code>true on success false on failure</div>
</div></div>
</div>
<a id="function_compareSignUp"></a><div class="element clickable function  function_compareSignUp" data-toggle="collapse" data-target=".function_compareSignUp .collapse">
<h2>A custom usort function for sorting promotion requests</h2>
<pre>compareSignUp(array $a, array $b) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Sorts the requests based upon which member has the least amount of requirements completed
it is based 1<em>the number of incomplete requirements+.5</em> the number of in-progress tasks</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$a</h4>
<code>array</code><p>the first item</p></div>
<div class="subelement argument">
<h4>$b</h4>
<code>array</code><p>the second item</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>0 if they are equal 1 if a is less -1 if a is greater</div>
</div></div>
</div>
<a id="function_compare_notif"></a><div class="element clickable function  function_compare_notif" data-toggle="collapse" data-target=".function_compare_notif .collapse">
<h2>Compares notifications to sort by presidence</h2>
<pre>compare_notif(\notification $a, \notification $b) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$a</h4>
<code><a href="../classes/notification.html">\notification</a></code><p>first one</p></div>
<div class="subelement argument">
<h4>$b</h4>
<code><a href="../classes/notification.html">\notification</a></code><p>second one</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>standard usort method returns</div>
</div></div>
</div>
<a id="function_connect"></a><div class="element clickable function  function_connect" data-toggle="collapse" data-target=".function_connect .collapse">
<h2>Connects to a database.</h2>
<pre>connect(String $username, String $password, String $server, String $db) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Use this function allow easy portability to other DBMSs</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$username</h4>
<code>String</code><p>the username</p></div>
<div class="subelement argument">
<h4>$password</h4>
<code>String</code><p>the password</p></div>
<div class="subelement argument">
<h4>$server</h4>
<code>String</code><p>the server you are connecting to</p></div>
<div class="subelement argument">
<h4>$db</h4>
<code>String</code><p>the default database to use</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>the mysqli connection on success false on failure</div>
</div></div>
</div>
<a id="function_displayResults"></a><div class="element clickable function  function_displayResults" data-toggle="collapse" data-target=".function_displayResults .collapse">
<h2>displayResults()
        </h2>
<pre>displayResults($display) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$display</h4></div>
</div></div>
</div>
<a id="function_display_event_search_in"></a><div class="element clickable function  function_display_event_search_in" data-toggle="collapse" data-target=".function_display_event_search_in .collapse">
<h2>Displays the input form to search for a specific event.</h2>
<pre>display_event_search_in(\type $ident) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code>\type</code><p>The database connection</p></div>
</div></div>
</div>
<a id="function_dropDownMenu"></a><div class="element clickable function  function_dropDownMenu" data-toggle="collapse" data-target=".function_dropDownMenu .collapse">
<h2>Creates a drop down &lt;select&gt; menu from a database query</h2>
<pre>dropDownMenu(String $query, String $name, <a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a> $identifier, boolean $hasotherfield, String $default, boolean $hasNoSelect) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>The first column needs to be the code for the variable to input to the server, column 2 is the text to display in the drop down</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$query</h4>
<code>String</code><p>the Query to run</p></div>
<div class="subelement argument">
<h4>$name</h4>
<code>String</code><p>the name of the input for the form</p></div>
<div class="subelement argument">
<h4>$identifier</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection</p></div>
<div class="subelement argument">
<h4>$hasotherfield</h4>
<code>boolean</code><p>true to allow users to select an other value</p></div>
<div class="subelement argument">
<h4>$default</h4>
<code>String</code><p>the code of the option to show by default</p></div>
<div class="subelement argument">
<h4>$hasNoSelect</h4>
<code>boolean</code><p>allows the user to not put input</p></div>
</div></div>
</div>
<a id="function_enterDate"></a><div class="element clickable function  function_enterDate" data-toggle="collapse" data-target=".function_enterDate .collapse">
<h2>Creates a input for entering a date</h2>
<pre>enterDate(bool $sameLine, String $append, \DateTime $default) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sameLine</h4>
<code>bool</code><p>true to have all the inputs inline, false stacks them</p></div>
<div class="subelement argument">
<h4>$append</h4>
<code>String</code><p>any string to add to the end of the input name to distinguish multiple date inputs</p></div>
<div class="subelement argument">
<h4>$default</h4>
<code><a href="http://php.net/manual/en/class.datetime.php">\DateTime</a></code><p>the Default date to show if neccessary</p></div>
</div></div>
</div>
<a id="function_execute"></a><div class="element clickable function  function_execute" data-toggle="collapse" data-target=".function_execute .collapse">
<h2>Executes a prepared Statement</h2>
<pre>execute(\mysqli_stmt $stmt) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>You need to bind the parameters before executing this.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$stmt</h4>
<code><a href="http://php.net/manual/en/class.mysqli_stmt.php">\mysqli_stmt</a></code><p>the prepared statement to execute.</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>for Select a mysqli_result, else true for success and false on failure</div>
</div></div>
</div>
<a id="function_getEventPromo"></a><div class="element clickable function  function_getEventPromo" data-toggle="collapse" data-target=".function_getEventPromo .collapse">
<h2>Gets a list of passed promotion requirements that are attendance based.</h2>
<pre>getEventPromo(\type $ident, \type $capid) : <a href="http://php.net/manual/en/class.datetime.php">\DateTime[]</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This includes:
Squadron Activities
Safety classes
Character Development
Encampment</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code>\type</code><p>The database connection</p></div>
<div class="subelement argument">
<h4>$capid</h4>
<code>\type</code><p>the user you're researching</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code><a href="http://php.net/manual/en/class.datetime.php">\DateTime[]</a></code>an array of the dates passed
The first level is the promotion it is for  the second level is the event type
AC= squadron activity
the subevent code from SUbevent_Types for the others</div>
</div></div>
</div>
<a id="function_hash_password"></a><div class="element clickable function  function_hash_password" data-toggle="collapse" data-target=".function_hash_password .collapse">
<h2>hash_password()
        </h2>
<pre>hash_password($pass, $salt) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$pass</h4></div>
<div class="subelement argument"><h4>$salt</h4></div>
</div></div>
</div>
<a id="function_insert_Event"></a><div class="element clickable function  function_insert_Event" data-toggle="collapse" data-target=".function_insert_Event .collapse">
<h2>Inserts the event.</h2>
<pre>insert_Event(\DateTime $startDate, String $type, String $name, Boolean $isCurrent, String $locat, \type $endDate) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>global</th>
<td>mysqli $ident the database connection</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$startDate</h4>
<code><a href="http://php.net/manual/en/class.datetime.php">\DateTime</a></code><p>the start date of the event</p></div>
<div class="subelement argument">
<h4>$type</h4>
<code>String</code><p>the type of the event</p></div>
<div class="subelement argument">
<h4>$name</h4>
<code>String</code><p>the name of the event</p></div>
<div class="subelement argument">
<h4>$isCurrent</h4>
<code>Boolean</code><p>whether this is the current event</p></div>
<div class="subelement argument">
<h4>$locat</h4>
<code>String</code><p>the location of the event</p></div>
<div class="subelement argument">
<h4>$endDate</h4>
<code>\type</code><p>the End date of the event or set to the string "null"</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>the event code of the event</div>
</div></div>
</div>
<a id="function_insert_Subevents"></a><div class="element clickable function  function_insert_Subevents" data-toggle="collapse" data-target=".function_insert_Subevents .collapse">
<h2>Takes the input subevent array, and inserts it into the database</h2>
<pre>insert_Subevents(\type $event_Code, array $subEvents) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>global</th>
<td>type $ident the database connection</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$event_Code</h4>
<code>\type</code><p>the event code of the event that the subevents are for</p></div>
<div class="subelement argument">
<h4>$subEvents</h4>
<code>array</code><p>the subevents that are being inserted</p></div>
</div></div>
</div>
<a id="function_insert_other_Subevents"></a><div class="element clickable function  function_insert_other_Subevents" data-toggle="collapse" data-target=".function_insert_other_Subevents .collapse">
<h2>Creates a new type of subevent</h2>
<pre>insert_other_Subevents(array $subEvents) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>global</th>
<td>mysqli $ident the database connection</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$subEvents</h4>
<code>array</code><p>the array of new subevents to make</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>returns all of the codes of the new created subevents</div>
</div></div>
</div>
<a id="function_logLogin"></a><div class="element clickable function  function_logLogin" data-toggle="collapse" data-target=".function_logLogin .collapse">
<h2>Logs login attempts, successful or not to LOGIN_LOG.</h2>
<pre>logLogin(Int $capid, boolean $success) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$capid</h4>
<code>Int</code><p>the USERs CAPID that the login was for</p></div>
<div class="subelement argument">
<h4>$success</h4>
<code>boolean</code><p>True if they were able to login false if they're login failed</p>
</div>
</div></div>
</div>
<a id="function_log_off"></a><div class="element clickable function  function_log_off" data-toggle="collapse" data-target=".function_log_off .collapse">
<h2>Destroys the user session.</h2>
<pre>log_off() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"><p>And logs the log off.</p></div></div></div>
</div>
<a id="function_minutesFromDecimal"></a><div class="element clickable function  function_minutesFromDecimal" data-toggle="collapse" data-target=".function_minutesFromDecimal .collapse">
<h2>Converts decimal form of minutes to mm:ss</h2>
<pre>minutesFromDecimal(Float $input) : String</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>Float</code><p>the decimal form of the minutes</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>String</code>the minutes in mm:ss</div>
</div></div>
</div>
<a id="function_monthArray"></a><div class="element clickable function  function_monthArray" data-toggle="collapse" data-target=".function_monthArray .collapse">
<h2>Returns an array of the months for enterDate</h2>
<pre>monthArray() : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>of the months</div>
</div></div>
</div>
<a id="function_newContact"></a><div class="element clickable function  function_newContact" data-toggle="collapse" data-target=".function_newContact .collapse">
<h2>Creates a form to input emergency contact information</h2>
<pre>newContact(Boolean $submit, <a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a> $identifier, String $page) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$submit</h4>
<code>Boolean</code><p>whether or not to have it's own form</p>
</div>
<div class="subelement argument">
<h4>$identifier</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection</p></div>
<div class="subelement argument">
<h4>$page</h4>
<code>String</code><p>the target page if $submit is true</p>
</div>
</div></div>
</div>
<a id="function_newContactType"></a><div class="element clickable function  function_newContactType" data-toggle="collapse" data-target=".function_newContactType .collapse">
<h2>Form to create a new Emergency Contact relationship</h2>
<pre>newContactType(String $page) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$page</h4>
<code>String</code><p>the target page</p></div>
</div></div>
</div>
<a id="function_newMember"></a><div class="element clickable function  function_newMember" data-toggle="collapse" data-target=".function_newMember .collapse">
<h2>Creates an input form for creating a new member</h2>
<pre>newMember(<a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a> $identifier, String $page, Int $capid) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$identifier</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the Datebase connection</p></div>
<div class="subelement argument">
<h4>$page</h4>
<code>String</code><p>the target page for the form</p></div>
<div class="subelement argument">
<h4>$capid</h4>
<code>Int</code><p>the CAPID if specified to display as the defualt CAPID</p></div>
</div></div>
</div>
<a id="function_newUnit"></a><div class="element clickable function  function_newUnit" data-toggle="collapse" data-target=".function_newUnit .collapse">
<h2>Creates a form to create a new Unit</h2>
<pre>newUnit(<a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a> $identifier, String $page) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$identifier</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection</p></div>
<div class="subelement argument">
<h4>$page</h4>
<code>String</code><p>the target page for the form</p></div>
</div></div>
</div>
<a id="function_newVisitor"></a><div class="element clickable function  function_newVisitor" data-toggle="collapse" data-target=".function_newVisitor .collapse">
<h2>Creates a form for inputing a new visitor to our unit</h2>
<pre>newVisitor(String $page, String $defaultFname, String $defaultLname) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$page</h4>
<code>String</code><p>the target page</p></div>
<div class="subelement argument">
<h4>$defaultFname</h4>
<code>String</code><p>the first name from the input to display by defualt</p></div>
<div class="subelement argument">
<h4>$defaultLname</h4>
<code>String</code><p>the last name from input to display by default</p></div>
</div></div>
</div>
<a id="function_numRows"></a><div class="element clickable function  function_numRows" data-toggle="collapse" data-target=".function_numRows .collapse">
<h2>Returns the number of rows in a mysql_result</h2>
<pre>numRows(\mysqli_result $result) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$result</h4>
<code><a href="http://php.net/manual/en/class.mysqli_result.php">\mysqli_result</a></code><p>the result to count</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>the number of rows returned</div>
</div></div>
</div>
<a id="function_parseMinutes"></a><div class="element clickable function  function_parseMinutes" data-toggle="collapse" data-target=".function_parseMinutes .collapse">
<h2>Parses mm:ss as a decimal of minutes</h2>
<pre>parseMinutes(\type $input) : float</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>\type</code>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>float</code>the $input as a decimal for of the time</div>
</div></div>
</div>
<a id="function_parsePercent"></a><div class="element clickable function  function_parsePercent" data-toggle="collapse" data-target=".function_parsePercent .collapse">
<h2>Parses percentage input and cleans it.</h2>
<pre>parsePercent(\type $append, array $inputs, \type $passing) : null | boolean | float</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$append</h4>
<code>\type</code><p>the appended stuff to post array</p></div>
<div class="subelement argument">
<h4>$inputs</h4>
<code>array</code><p>the post array</p></div>
<div class="subelement argument">
<h4>$passing</h4>
<code>\type</code><p>the passing percentage as a decimal</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>null</code><code>boolean</code><code>float</code>returns null if no input, false if incorrent or not passing, and the percentage as a float</div>
</div></div>
</div>
<a id="function_parsePromoInput"></a><div class="element clickable function  function_parsePromoInput" data-toggle="collapse" data-target=".function_parsePromoInput .collapse">
<h2>Parse the input from the promotion sign-up and insert it</h2>
<pre>parsePromoInput(\mysqli $ident, array $input) : Void</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Inserts the promotion information into                                                                           qqqqq the SQL database.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>The resource for a SQL connection</p></div>
<div class="subelement argument">
<h4>$input</h4>
<code>array</code><p>the input array to be inserted</p></div>
<h3>Returns</h3>
<div class="subelement response"><code>Void</code></div>
</div></div>
</div>
<a id="function_parse_Sub_events"></a><div class="element clickable function  function_parse_Sub_events" data-toggle="collapse" data-target=".function_parse_Sub_events .collapse">
<h2>Parses the the sube event input and inserts it</h2>
<pre>parse_Sub_events(array $input) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>array</code><p>the Input array, usually $_POST</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>an array of the parsed inputs index is order of the input, the content is the subevent code.</div>
</div></div>
</div>
<a id="function_parse_date_input"></a><div class="element clickable function  function_parse_date_input" data-toggle="collapse" data-target=".function_parse_date_input .collapse">
<h2>Parses and cleans the input from an enterDate() form</h2>
<pre>parse_date_input(array $input, \Strin $append) : null | <a href="http://php.net/manual/en/class.datetime.php">\DateTime</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$input</h4>
<code>array</code><p>the array input usually $_POST</p>
</div>
<div class="subelement argument">
<h4>$append</h4>
<code>\Strin</code><p>the string that was appended in enterDate()</p>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>null</code><code><a href="http://php.net/manual/en/class.datetime.php">\DateTime</a></code>null if there was no input the DateTime object if a date was given</div>
</div></div>
</div>
<a id="function_prepDisplay"></a><div class="element clickable function  function_prepDisplay" data-toggle="collapse" data-target=".function_prepDisplay .collapse">
<h2>prepDisplay()
        </h2>
<pre>prepDisplay($results_sorted) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$results_sorted</h4></div>
</div></div>
</div>
<a id="function_prepare_statement"></a><div class="element clickable function  function_prepare_statement" data-toggle="collapse" data-target=".function_prepare_statement .collapse">
<h2>Prepares a prepared-statement from the query provided and the database connection</h2>
<pre>prepare_statement(\mysqli $ident, \type $query) : <a href="http://php.net/manual/en/class.mysqli_stmt.php">\mysqli_stmt</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection to use for the prepared statement</p></div>
<div class="subelement argument">
<h4>$query</h4>
<code>\type</code><p>the query for the prepared statement</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code><a href="http://php.net/manual/en/class.mysqli_stmt.php">\mysqli_stmt</a></code>the prepared statement created</div>
</div></div>
</div>
<a id="function_promoRequireInput"></a><div class="element clickable function  function_promoRequireInput" data-toggle="collapse" data-target=".function_promoRequireInput .collapse">
<h2>Creates an input field to input promotion score, and date</h2>
<pre>promoRequireInput(Integer $capid, String $type, \DateTime $date, float $percentage, string $achiev, $tester, string $code) : \returns</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Displays input tags to get the input for entering a promotion requirement
passage.  This only creates the input, and does not parse or handle the input</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$capid</h4>
<code>Integer</code><p>The capid of who it is</p></div>
<div class="subelement argument">
<h4>$type</h4>
<code>String</code><p>the requirement type this is for</p></div>
<div class="subelement argument">
<h4>$date</h4>
<code><a href="http://php.net/manual/en/class.datetime.php">\DateTime</a></code><p>The date passed if any</p></div>
<div class="subelement argument">
<h4>$percentage</h4>
<code>float</code><p>the percentage stored if already passed</p></div>
<div class="subelement argument">
<h4>$achiev</h4>
<code>string</code><p>The achievement this is for</p></div>
<div class="subelement argument"><h4>$tester</h4></div>
<div class="subelement argument">
<h4>$code</h4>
<code>string</code><p>The event code for attendance requirements</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>\returns</code>whether or not more needs to be displayed.</div>
</div></div>
</div>
<a id="function_promotionAprove"></a><div class="element clickable function  function_promotionAprove" data-toggle="collapse" data-target=".function_promotionAprove .collapse">
<h2>Displays the table for aproving the promotion requests.</h2>
<pre>promotionAprove(<a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a> $ident, String $memberType, boolean $approve) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection</p></div>
<div class="subelement argument">
<h4>$memberType</h4>
<code>String</code><p>the member type that the promotion requests are to be displayed for</p></div>
<div class="subelement argument">
<h4>$approve</h4>
<code>boolean</code><p>whether or not the member can approve the promotion</p></div>
</div></div>
</div>
<a id="function_punchIt"></a><div class="element clickable function  function_punchIt" data-toggle="collapse" data-target=".function_punchIt .collapse">
<h2>punchIt()
        </h2>
<pre>punchIt($code) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$code</h4></div>
</div></div>
</div>
<a id="function_report"></a><div class="element clickable function  function_report" data-toggle="collapse" data-target=".function_report .collapse">
<h2>report()
        </h2>
<pre>report($eCode) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$eCode</h4></div>
</div></div>
</div>
<a id="function_reportDbError"></a><div class="element clickable function  function_reportDbError" data-toggle="collapse" data-target=".function_reportDbError .collapse">
<h2>Logs a database error, and displays an error message to the user</h2>
<pre>reportDbError(String $errorno, String $error) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>WARNING: for development displays the error code, and more information, this needs
to be removed for production servers</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$errorno</h4>
<code>String</code><p>the Mysql error</p></div>
<div class="subelement argument">
<h4>$error</h4>
<code>String</code><p>the error text from Mysql</p></div>
</div></div>
</div>
<a id="function_rows_affected"></a><div class="element clickable function  function_rows_affected" data-toggle="collapse" data-target=".function_rows_affected .collapse">
<h2>Reutrns the number of rows affected by the last query</h2>
<pre>rows_affected(\mysqli $ident) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code><a href="http://php.net/manual/en/class.mysqli.php">\mysqli</a></code><p>the database connection from</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>the number of rows affected</div>
</div></div>
</div>
<a id="function_search"></a><div class="element clickable function  function_search" data-toggle="collapse" data-target=".function_search .collapse">
<h2>search()
        </h2>
<pre>search() </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="function_searchEvent"></a><div class="element clickable function  function_searchEvent" data-toggle="collapse" data-target=".function_searchEvent .collapse">
<h2>Searchs for an event from the display_event_search_in()</h2>
<pre>searchEvent(\type $ident, \type $callable, \type $link) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>If there is a single result it will call the specified function. Otherwise it
will display the results as links to link.  The links will have the event codes as a get field
?eCode=9Mar13M</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code>\type</code><p>The database Connection</p></div>
<div class="subelement argument">
<h4>$callable</h4>
<code>\type</code><p>the function to call on a single result</p></div>
<div class="subelement argument">
<h4>$link</h4>
<code>\type</code><p>the link to go to if there are mutliple results</p></div>
</div></div>
</div>
<a id="function_session_predict_path"></a><div class="element clickable function  function_session_predict_path" data-toggle="collapse" data-target=".function_session_predict_path .collapse">
<h2>Creates an array of pages the user is allowed to see.</h2>
<pre>session_predict_path(\type $ident, \type $capid, \type $page) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>The pages the user has permissions are added. Then pages that are allowed to be seen
after the page the user is on. i.e. the page to confirm a member deletion from
the member delete page.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code>\type</code><p>The databse connection of user ViewNext</p></div>
<div class="subelement argument">
<h4>$capid</h4>
<code>\type</code><p>The user we're looking at only for establishing sessions</p>
</div>
<div class="subelement argument">
<h4>$page</h4>
<code>\type</code><p>The page to create the list for if not the current page</p></div>
</div></div>
</div>
<a id="function_session_resign_in"></a><div class="element clickable function  function_session_resign_in" data-toggle="collapse" data-target=".function_session_resign_in .collapse">
<h2>Forces a user to resign in if there is a threat against their session.</h2>
<pre>session_resign_in(boolean $allowSignIn) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$allowSignIn</h4>
<code>boolean</code><p>allowSignIn false won't resign in just show dead session true allows to resign in</p>
</div>
</div></div>
</div>
<a id="function_session_secure_start"></a><div class="element clickable function  function_session_secure_start" data-toggle="collapse" data-target=".function_session_secure_start .collapse">
<h2>Starts a session, and checks for foul play</h2>
<pre>session_secure_start(Int $capid) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This checks first for session hijacking by checking the request is from the
right IP address, it will also update the session key. It will then check if
the user is allowed to view this page using a list from session_predict_path.
If there is a threat it will force the user to resign in.</p>

<p>Uses the following Session variables
ip_addr= the ip_address to be used
predicted- the pages the user can see
last- the last visited page
-request - an array of the last used request header
      -agent- the user agent
      -accept- the accept header
      -lang_char- the accepted language and charset
      -encoding- the accepted encoding
- resignin- force user to resign in 0 - must resignin 1- another request</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$capid</h4>
<code>Int</code><p>the capid of the user for creating the session should be used only
by /login/index.php</p>
</div>
</div></div>
</div>
<a id="function_specialPromoRequire"></a><div class="element clickable function  function_specialPromoRequire" data-toggle="collapse" data-target=".function_specialPromoRequire .collapse">
<h2>Returns an array of all the promotion requirements that are event based</h2>
<pre>specialPromoRequire(\Mysqli $ident) : Array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$ident</h4>
<code>\Mysqli</code><p>the database connection</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>Array</code>the type codes of all the promotion requirements that are attendance based.</div>
</div></div>
</div>
<a id="function_verifyCPFT"></a><div class="element clickable function  function_verifyCPFT" data-toggle="collapse" data-target=".function_verifyCPFT .collapse">
<h2>Checks if the tester passed the CPFT</h2>
<pre>verifyCPFT($ident, array $requirements, array $actual) : true</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument"><h4>$ident</h4></div>
<div class="subelement argument">
<h4>$requirements</h4>
<code>array</code><p>an array from retrieveCPFTrequire</p></div>
<div class="subelement argument">
<h4>$actual</h4>
<code>array</code><code>\ident</code><p>an array of the actual scores</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>true</code>iff they passed, false if otherwise</div>
</div></div>
</div>
<a id="function_verify_password"></a><div class="element clickable function  function_verify_password" data-toggle="collapse" data-target=".function_verify_password .collapse">
<h2>Verifies a password meets password requirements</h2>
<pre>verify_password(String $pass, String $retype, String $old, Boolean $checkOld) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>Verifies the given passwords match. Sanatizes the password.
Then verifies it meets CAPR110-1 guidance.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$pass</h4>
<code>String</code>
</div>
<div class="subelement argument">
<h4>$retype</h4>
<code>String</code>
</div>
<div class="subelement argument">
<h4>$old</h4>
<code>String</code><ul>
<li>the old password to check the passwords did change</li>
</ul>
</div>
<div class="subelement argument">
<h4>$checkOld</h4>
<code>Boolean</code><p>true to check the old password, false if this the first password</p></div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>0=>boolean, true passed, false otherwise, 1=>the password on success,1+=> the error message(s) otherwise each message it's own index</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-class"></i> Classes and interfaces</h3>
<div id="contact" class="element ajax clickable class">
<h1>contact<a href="../classes/contact.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/contact.html" class="more">« More »</a>
</div>
<div id="member" class="element ajax clickable class">
<h1>member<a href="../classes/member.html">¶</a>
</h1>
<p class="short_description">A class for CAP members</p>
<div class="details collapse"></div>
<a href="../classes/member.html" class="more">« More »</a>
</div>
<div id="memberType" class="element ajax clickable class">
<h1>memberType<a href="../classes/memberType.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/memberType.html" class="more">« More »</a>
</div>
<div id="notification" class="element ajax clickable class">
<h1>notification<a href="../classes/notification.html">¶</a>
</h1>
<p class="short_description">The class for notifications for a user.</p>
<div class="details collapse"></div>
<a href="../classes/notification.html" class="more">« More »</a>
</div>
<div id="relationShip" class="element ajax clickable class">
<h1>relationShip<a href="../classes/relationShip.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/relationShip.html" class="more">« More »</a>
</div>
<div id="searched_member" class="element ajax clickable class">
<h1>searched_member<a href="../classes/searched_member.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/searched_member.html" class="more">« More »</a>
</div>
<div id="unit" class="element ajax clickable class">
<h1>unit<a href="../classes/unit.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/unit.html" class="more">« More »</a>
</div>
<div id="visitor" class="element ajax clickable class">
<h1>visitor<a href="../classes/visitor.html">¶</a>
</h1>
<p class="short_description"></p>
<div class="details collapse"></div>
<a href="../classes/visitor.html" class="more">« More »</a>
</div>
<h3>
<i class="icon-custom icon-constant"></i> Constants</h3>
<a id="constant_BAD_LOGIN_WAIT"> </a><div class="element clickable constant  constant_BAD_LOGIN_WAIT" data-toggle="collapse" data-target=".constant_BAD_LOGIN_WAIT .collapse">
<h2>BAD_LOGIN_WAIT</h2>
<pre>BAD_LOGIN_WAIT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_BAD_LOGIN_WAIT"> </a><div class="element clickable constant  constant_BAD_LOGIN_WAIT" data-toggle="collapse" data-target=".constant_BAD_LOGIN_WAIT .collapse">
<h2>BAD_LOGIN_WAIT</h2>
<pre>BAD_LOGIN_WAIT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_CPFT_OTHER_REQ"> </a><div class="element clickable constant  constant_CPFT_OTHER_REQ" data-toggle="collapse" data-target=".constant_CPFT_OTHER_REQ .collapse">
<h2>CPFT_OTHER_REQ</h2>
<pre>CPFT_OTHER_REQ </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_CPFT_RUNNING_REQ"> </a><div class="element clickable constant  constant_CPFT_RUNNING_REQ" data-toggle="collapse" data-target=".constant_CPFT_RUNNING_REQ .collapse">
<h2>CPFT_RUNNING_REQ</h2>
<pre>CPFT_RUNNING_REQ </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_CSV_SAVE_PATH"> </a><div class="element clickable constant  constant_CSV_SAVE_PATH" data-toggle="collapse" data-target=".constant_CSV_SAVE_PATH .collapse">
<h2>CSV_SAVE_PATH</h2>
<pre>CSV_SAVE_PATH </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_CSV_SAVE_PATH"> </a><div class="element clickable constant  constant_CSV_SAVE_PATH" data-toggle="collapse" data-target=".constant_CSV_SAVE_PATH .collapse">
<h2>CSV_SAVE_PATH</h2>
<pre>CSV_SAVE_PATH </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_EVENT_CODE_DATE"> </a><div class="element clickable constant  constant_EVENT_CODE_DATE" data-toggle="collapse" data-target=".constant_EVENT_CODE_DATE .collapse">
<h2>EVENT_CODE_DATE</h2>
<pre>EVENT_CODE_DATE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_LOCK_TIME"> </a><div class="element clickable constant  constant_LOCK_TIME" data-toggle="collapse" data-target=".constant_LOCK_TIME .collapse">
<h2>LOCK_TIME</h2>
<pre>LOCK_TIME </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_LOCK_TIME"> </a><div class="element clickable constant  constant_LOCK_TIME" data-toggle="collapse" data-target=".constant_LOCK_TIME .collapse">
<h2>LOCK_TIME</h2>
<pre>LOCK_TIME </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_LOG_PER_PAGE"> </a><div class="element clickable constant  constant_LOG_PER_PAGE" data-toggle="collapse" data-target=".constant_LOG_PER_PAGE .collapse">
<h2>LOG_PER_PAGE</h2>
<pre>LOG_PER_PAGE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_LOG_PER_PAGE"> </a><div class="element clickable constant  constant_LOG_PER_PAGE" data-toggle="collapse" data-target=".constant_LOG_PER_PAGE .collapse">
<h2>LOG_PER_PAGE</h2>
<pre>LOG_PER_PAGE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_MAX_LOGIN"> </a><div class="element clickable constant  constant_MAX_LOGIN" data-toggle="collapse" data-target=".constant_MAX_LOGIN .collapse">
<h2>MAX_LOGIN</h2>
<pre>MAX_LOGIN </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_MAX_LOGIN"> </a><div class="element clickable constant  constant_MAX_LOGIN" data-toggle="collapse" data-target=".constant_MAX_LOGIN .collapse">
<h2>MAX_LOGIN</h2>
<pre>MAX_LOGIN </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_NOTIF_PATH"> </a><div class="element clickable constant  constant_NOTIF_PATH" data-toggle="collapse" data-target=".constant_NOTIF_PATH .collapse">
<h2>NOTIF_PATH</h2>
<pre>NOTIF_PATH </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PASSWORD_LIFE"> </a><div class="element clickable constant  constant_PASSWORD_LIFE" data-toggle="collapse" data-target=".constant_PASSWORD_LIFE .collapse">
<h2>PASSWORD_LIFE</h2>
<pre>PASSWORD_LIFE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PASSWORD_LIFE"> </a><div class="element clickable constant  constant_PASSWORD_LIFE" data-toggle="collapse" data-target=".constant_PASSWORD_LIFE .collapse">
<h2>PASSWORD_LIFE</h2>
<pre>PASSWORD_LIFE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PASSWORD_NOTIF"> </a><div class="element clickable constant  constant_PASSWORD_NOTIF" data-toggle="collapse" data-target=".constant_PASSWORD_NOTIF .collapse">
<h2>PASSWORD_NOTIF</h2>
<pre>PASSWORD_NOTIF </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PASSWORD_NOTIF"> </a><div class="element clickable constant  constant_PASSWORD_NOTIF" data-toggle="collapse" data-target=".constant_PASSWORD_NOTIF .collapse">
<h2>PASSWORD_NOTIF</h2>
<pre>PASSWORD_NOTIF </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PHP_DATE_FORMAT"> </a><div class="element clickable constant  constant_PHP_DATE_FORMAT" data-toggle="collapse" data-target=".constant_PHP_DATE_FORMAT .collapse">
<h2>PHP_DATE_FORMAT</h2>
<pre>PHP_DATE_FORMAT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PHP_DATE_FORMAT"> </a><div class="element clickable constant  constant_PHP_DATE_FORMAT" data-toggle="collapse" data-target=".constant_PHP_DATE_FORMAT .collapse">
<h2>PHP_DATE_FORMAT</h2>
<pre>PHP_DATE_FORMAT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PHP_TIMESTAMP_FORMAT"> </a><div class="element clickable constant  constant_PHP_TIMESTAMP_FORMAT" data-toggle="collapse" data-target=".constant_PHP_TIMESTAMP_FORMAT .collapse">
<h2>PHP_TIMESTAMP_FORMAT</h2>
<pre>PHP_TIMESTAMP_FORMAT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PHP_TIMESTAMP_FORMAT"> </a><div class="element clickable constant  constant_PHP_TIMESTAMP_FORMAT" data-toggle="collapse" data-target=".constant_PHP_TIMESTAMP_FORMAT .collapse">
<h2>PHP_TIMESTAMP_FORMAT</h2>
<pre>PHP_TIMESTAMP_FORMAT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PHP_TO_MYSQL_FORMAT"> </a><div class="element clickable constant  constant_PHP_TO_MYSQL_FORMAT" data-toggle="collapse" data-target=".constant_PHP_TO_MYSQL_FORMAT .collapse">
<h2>PHP_TO_MYSQL_FORMAT</h2>
<pre>PHP_TO_MYSQL_FORMAT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PROFILE_PATH"> </a><div class="element clickable constant  constant_PROFILE_PATH" data-toggle="collapse" data-target=".constant_PROFILE_PATH .collapse">
<h2>PROFILE_PATH</h2>
<pre>PROFILE_PATH </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PROFILE_PATH"> </a><div class="element clickable constant  constant_PROFILE_PATH" data-toggle="collapse" data-target=".constant_PROFILE_PATH .collapse">
<h2>PROFILE_PATH</h2>
<pre>PROFILE_PATH </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PROMOTION_WAIT"> </a><div class="element clickable constant  constant_PROMOTION_WAIT" data-toggle="collapse" data-target=".constant_PROMOTION_WAIT .collapse">
<h2>PROMOTION_WAIT</h2>
<pre>PROMOTION_WAIT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_PSSWD_INI"> </a><div class="element clickable constant  constant_PSSWD_INI" data-toggle="collapse" data-target=".constant_PSSWD_INI .collapse">
<h2>PSSWD_INI</h2>
<pre>PSSWD_INI </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_SQL_INSERT_DATE_TIME"> </a><div class="element clickable constant  constant_SQL_INSERT_DATE_TIME" data-toggle="collapse" data-target=".constant_SQL_INSERT_DATE_TIME .collapse">
<h2>SQL_INSERT_DATE_TIME</h2>
<pre>SQL_INSERT_DATE_TIME </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a12</a> and<br>
            generated on 2013-10-13T16:49:19-06:00.<br></footer></div>
</div>
</body>
</html>
